package com.aiyi.server.manager.nginx.utils;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.Calendar;
import java.util.Date;

/**
 * @author ：崔辉
 * @date ：Created in 2021/9/9 21:38
 * @description：时间工具类
 * @modified By：
 */
public class DateUtils {
    /**
     * 毫秒字符串
     * @return
     */
    public static String getTimeStr(){
        return new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
    }

    /**
     * 十天前
     * @return
     */
    public static int getDateStrBefore10(){
        Calendar now = Calendar.getInstance();
        now.add(Calendar.DAY_OF_MONTH, -10);
        String endDate = new SimpleDateFormat("yyyyMMdd").format(now.getTime());
        return Integer.parseInt(endDate);
    }
}
